﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="FPC.Offer.UI.Login" %>

<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link href="../H-ui/static/h-ui/css/H-ui.min.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/H-ui.login.css" rel="stylesheet" />
    <link href="../H-ui/static/h-ui.admin/css/style.css" rel="stylesheet" />
    <link href="../H-ui/Lib/Hui-iconfont/1.0.8/iconfont.css" rel="stylesheet" />
    <link href="../H-ui/Lib/layer-v3.0.3/layer/skin/default/layer.css" rel="stylesheet" />
    <title>登录</title>
    
</head>
<body>
    <input type="hidden" id="TenantId" name="TenantId" value="" />
    <div class="header"></div>
    <div class="loginWraper">
        <div id="loginform" class="loginBox">
            <form class="form form-horizontal">
                <div class="row cl">
                    <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60d;</i></label>
                    <div class="formControls col-xs-8">
                        <input id="Account" name="" type="text" placeholder="账户" class="input-text size-L">
                    </div>
                </div>
                <div class="row cl">
                    <label class="form-label col-xs-3"><i class="Hui-iconfont">&#xe60e;</i></label>
                    <div class="formControls col-xs-8">
                        <input id="Pwd" name="" type="password" placeholder="密码" class="input-text size-L">
                    </div>
                </div>
                <div class="row cl">
                    <div class="formControls col-xs-8 col-xs-offset-3">
                        <input class="input-text size-L" type="text" placeholder="验证码" style="width: 150px;" id="ValidateCode">
                        <img alt="" src="../GeneralProcessor/Login/ValidateCode.ashx" onclick="this.src = '../GeneralProcessor/Login/ValidateCode.ashx?d='+new Date()" style="width: 90px; height: 42px;" id="yanzheng" width="90" height="42" />
                        <span><a href="javascript:;" onclick="document.getElementById('yanzheng').src = '../GeneralProcessor/Login/ValidateCode.ashx?d='+new Date()">点一下，换一张</a> </span>
                    </div>
                </div>

                <div class="row cl">
                    <div class="formControls col-xs-8 col-xs-offset-3">
                        <input type="button" class="btn btn-success radius size-L" onclick="Login()" value="&nbsp;登&nbsp;&nbsp;&nbsp;&nbsp;录&nbsp;" />
                        <input type="reset" class="btn btn-default radius size-L" value="&nbsp;取&nbsp;&nbsp;&nbsp;&nbsp;消&nbsp;" />
                    </div>
                </div>
            </form>
        </div>
    </div>
    <div class="footer">青海森林森林公安局在线管理系统</div>   
    <script src="../H-ui/Lib/jquery/1.9.1/jquery.min.js"></script>
    <script src="../H-ui/Lib/layer-v3.0.3/layer/layer.js"></script>
    <script type="text/javascript">

        /*
        编写人：孔辉
        编写时间：2017/5/3
        修改人：
        修改时间：
        */
        function Login() {
            $.ajax({
                type: "post",
                url: "../GeneralProcessor/Login/UserLogin.ashx",
                data: {
                    Account: $("#Account").val(),
                    Pwd: $("#Pwd").val(),
                    ValidateCode: $("#ValidateCode").val(),
                    Acction:"<%=FPC.Offer.Common.EnumAction.Login.ToString()%>",
                },
                success: function (res) {
                    switch (res) {
                        case "0":
                            layer.alert("验证码有误，请从新输入")
                            $("#ValidateCode").focus();
                            break;
                        case "1":
                            layer.alert("账号不存在，请从新输入")
                            $("#Account").focus();
                            break;
                        case "2":
                           layer.alert("密码错误，请从新输入")
                            $("#Pwd").focus();
                            break;
                        case "3":
                            location.href = 'Deflaut.aspx';
                            break;                      
                    }
                }
            })
        }
    </script>
</body>
</html>

